//
//  BaseViewController.swift
//  CardBag
//
//  Created by hl on 2019/5/16.
//  Copyright © 2019 hlznj. All rights reserved.
//

import UIKit

class BaseViewController: UIViewController {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.backgroundColor = UIColor.white

        if self.navigationController == nil {
            return
        }

        //返回按钮
        if (self.navigationController?.viewControllers.count)! > 1 {
            self.navigationItem.leftBarButtonItem = UIBarButtonItem.init(image: UIImage.init(named: "backitem")?.withRenderingMode(.alwaysOriginal), style: .plain, target: self, action: #selector(backBtnAction))
        }
    }

    @objc func backBtnAction() {
        self.navigationController!.popViewController(animated: true)
    }
}
